package com.stations.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.stations.common.web.domain.request.PageDomain;
import com.stations.domain.TTransmitterTask;
import com.stations.mapper.TTransmitterTaskMapper;
import com.stations.service.TrasmiterTaskService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;

/**
 * Describe: 用户服务实现类
 * Author: Ljy
 * CreateTime: 2019/10/23
 */
@Service
public class TrasmiterTaskServiceImpl extends ServiceImpl<TTransmitterTaskMapper, TTransmitterTask> implements TrasmiterTaskService {

    @Resource
    private TTransmitterTaskMapper tTransmitterTaskMapper;
    @Override
    public PageInfo<TTransmitterTask> selectTTransmitterTaskPage(TTransmitterTask tTransmitterTask, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(), pageDomain.getLimit());
        List<TTransmitterTask> data = tTransmitterTaskMapper.selectTTransmitterTaskList(tTransmitterTask);
        return new PageInfo<>(data);
    }

    /**
     * 添加发射机节目
     * @param
     * @return
     */
    @Override
    public void addTTransmitterTask(TTransmitterTask tTransmitterTask) {
        tTransmitterTask.setTaskCode(UUID.randomUUID().toString());
        int insert = tTransmitterTaskMapper.insert(tTransmitterTask);
    }
}
